package www.albertzhe.askForLeave;

import java.util.List;

import www.albertzhe.askForLeave.impl.RatifyChainImpl;
import www.albertzhe.askForLeave.impl.Request;
import www.albertzhe.askForLeave.impl.Result;

/**
 * 类描述：责任链模模式工具类
 * 
 */
public class AppStart {
    /**
     * 执行请求
     * @param ratifies 批准的链
     * @param request 待批准的请求
     * @return
     */
    public Result execute(List<Ratify> ratifies, Request request) {
        RatifyChainImpl realChain = new RatifyChainImpl(ratifies, request, 0);
        return realChain.proceed(request);
    }

}
